﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>登录页</title>
    <script src="~/Scripts/EasyUI/jquery.min.js"></script>
    <script src="~/Scripts/EasyUI/jquery.easyui.min.js"></script>
    <link href="~/Scripts/EasyUI/themes/gray/easyui.css" rel="stylesheet" />
    <link href="~/Scripts/EasyUI/themes/icon.css" rel="stylesheet" />
</head>
<body>
    <div id="win2" style="width: 300px; height: 200px" class="easyui-window" data-options="modal:true,closed:false" title="登录">
        <div style="width: 100%; text-align: center">
               <br />
            用户：&nbsp;<input type="text" name="userName" class="textbox" id="userName" />
            <br />
            <br />
            密码：&nbsp;<input type="password" name="passWord" class="textbox" id="passWord" />
            <br />
            <br />
            <input type="button" id="btnLogin" value="登录" />
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $("#btnLogin").click(function () {
            var userName = $("#userName").val();
            var passWord = $("#passWord").val();
            if ($.trim(userName) != "" && $.trim(passWord) != "") {
                $.ajax({
                    url: "@Url.Action("DoLogin", "JiaQQNew")",
                    type: 'post',
                    data: { userName: userName, passWord: passWord },
                    success: function (data) {
                        if (data == "1") {
                            window.location.href = "@Url.Action("QQqunManage", "JiaQQNew")";
                        } else {
                            alert("用户名或者密码错误！");
                        }
                    }
                });
            }
            else {
                alert("用户名密码不能为空！");
            }
        });
    });
</script>
